{% load static %}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>搜音乐</title>
    <link rel="stylesheet" type="text/css" href="/songstatic/css/new_file.css"/>
    <link rel="stylesheet" type="text/css" href="/songstatic/css/bootstrap.min.css"/>
</head>
    <body class="Bigbox" style="height: 400px;width: 1000px;margin: 0 auto;">
        <!--头部-->
        <div class="nav">

            <img class="logo" src="{% static 'img/logo.jpg' %}"/>

            <div class="nav1">
                <ul>
                    <li><a href="#">&nbsp;&nbsp;&nbsp;首页&nbsp;&nbsp;&nbsp;</a></li>
                    <li><a href="#">全网推荐</a></li>
                    <li><a href="#">播放历史</a></li>
                    <li><a href="#">个人收藏</a></li>
                    <li class="register"><a href="#">注册</a></li>
                    <li class="login"><a href="#">登陆</a></li>
                </ul>
            </div>
        </div>
        <div class="more_cols clearfix">
        <div class="more_cols_left">
            <div class="more_cols_left_inner">
                <div class="search_box" data-spm="23309989">
                    <form class="big_search_form" name="searchindex"
                          action="{% url 'haystack:haystack_search' %}" method="get"
                          >

                            {% ifequal search_method 'songname'  %}
                                <select name="search-method" style="width: 70px;height:35px;margin-left: 50px;padding: 0">
                                    <option selected>歌名</option>
                                    <option >歌手</option>
                                    <option >歌词</option>
                                </select>
                            {% endifequal %}

                            {% ifequal search_method 'singer' %}
                                <select name="search-method" style="width: 70px;height:35px;margin-left: 100px;padding: 0">
                                    <option >歌名</option>
                                    <option selected>歌手</option>
                                    <option >歌词</option>
                                </select>
                            {% endifequal %}
                            {% ifequal search_method 'lyric' %}
                                <select name="search-method" style="width: 70px;height:35px;margin-left: 100px;padding: 0">
                                    <option >歌名</option>
                                    <option >歌手</option>
                                    <option selected>歌词</option>
                                </select>
                            {% endifequal %}

                        <input class="big_search grey" type="text" id="search_text" name="q" style="margin-left: 0"
                               title="喜欢就搜搜吧" placeholder="&nbsp;&nbsp;&nbsp;搜索您感兴趣的专辑/歌曲/艺人"
                               onfocus="search_focus('click');" onblur="search_focus('blur');">
                        <input class="big_search_bt" type="submit" value="搜索" id="musicsearch">
                    </form>
                    <span class="hints">左边下拉框可以选择歌词或者歌手搜索</span>
                    <div class="found-result" style="width: 800px;height:200px;overflow: auto;margin: 10px auto;margin-left: 100px">
                        {% if query %}

                            {% ifequal search_method 'lyric' %}
                                {% for result in object_list %}
                                    {% ifequal no_whoosh 'no_whoosh'%}
                                        播放:{{ result.playnum }}&nbsp; &nbsp;&nbsp;
                                        评论:{{ result.commentnum }}&nbsp;&nbsp;&nbsp;

                                        <a href="{% url 'song:search_song' result.sid %}  " target="_self">{{ result.name }} {{ result.singer }}</a> <br/>
                                    {% else %}
                                        播放:{{ result.object.playnum }}&nbsp; &nbsp;&nbsp;
                                        评论:{{ result.object.commentnum }}&nbsp;&nbsp;&nbsp;
                                        <a href="{% url 'song:search_song' result.object.sid %}  " target="_self">{{ result.object.name }} {{ result.object.singer }}</a><br/>

                                    {% endifequal %}

                                    {% empty %}
                                    <p>试下输入歌手或者歌名搜索吧！！！</p>


                                {% endfor %}

                                {% else %}
                                <div style="height: 60px;">
                                    {% for result in object_list %}
                                        播放:{{ result.playnum }}&nbsp; &nbsp;&nbsp;
                                        评论:{{ result.commentnum }}&nbsp;&nbsp;&nbsp;

                                        <a href="{% url 'song:search_song' result.sid %}  " target="_self">{{ result.name }} {{ result.singer }}</a><br/>

                                        {% empty %}
                                        <p>试下左边的下拉框选择歌词搜索吧！！！</p>

                                    {% endfor %}
                                </div>
                            {% endifequal %}

{#                            {% if page.has_previous or page.has_next %}#}
{#                                <div>#}
{#                                    {% if page.has_previous %}#}
{#                                        <a href="?q={{ query }}&page={{ page.previous_page_number }}">#}
{#                                    {% endif %}#}
{#                                    « 上一页#}
{#                                    {% if page.has_previous %}#}
{#                                        </a>#}
{#                                    {% endif %}#}
{#                                |#}
{#                                    {% if page.has_next %}#}
{#                                        <a href="?q={{ query }}&page={{ page.next_page_number }}">#}
{#                                    {% endif %}下一页 »{% if page.has_next %}#}
{#                                    </a>#}
{#                                {% endif %}#}
{#                                </div>#}
{#                            {% endif %}#}
                        {% endif %}
                    </div>
                </div>

            </div>
        </div>

    </body>
</html>
